package com.sky.controller.user;

import com.sky.constant.StatusConstant;
import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author hm
 * @version 1.0
 * @date Created in 2024/7/10 15:06
 */
@RestController("userShopController")
@RequestMapping("/user/shop")
@Api(tags = "店铺相关接口")
@Slf4j
public class ShopController {
    @Resource
    private StringRedisTemplate stringRedisTemplate;
    @GetMapping("/{status}")
    @ApiOperation("获取店铺状态")
    public Result getShopStatus(){
        log.info("获取营业状态");
        String status = stringRedisTemplate.opsForValue().get(StatusConstant.SHOP_STATUS_KEY);
        return Result.success(status);
    }
}
